home *** CD-ROM | disk | FTP | other *** search
- page 132,66,0,6
- opt rc
- ;*******************************************
- ;Motorola Austin DSP Operation June 30,1988
- ;*******************************************
- ;DSP96001/2
- ;20 tap FIR filter
- ;File name: 1-96.asm
- ;**************************************************************************
- ; Maximum sample rate: 435.5 KHz at 27.0 MHz
- ; Memory Size: Prog: 4+9 words ; Data :2 x 20 words
- ; Number of clock cycles: 62 (31 instruction cycles)
- ; Clock Frequency: 27.0 MHz
- ; Cycle time: 74.1ns
- ;**************************************************************************
- ; This FIR filter reads the input sample
- ; from the memory location Y:input
- ; and writes the filtered output sample
- ; to the memory location Y:output
- ;
- ; The samples are stored in the X memory
- ; The coefficients are stored in the Y memory
- ;**************************************************************************
- ;
- ; X MEMORY Y MEMORY
- ;
- ; | | | |
- ; R0 |--------| |--------|
- ; +----->| X(n) | +----->| c(0) |
- ; | t |--------| |t,t+T |--------|
- ; | | X(n-1) | | | c(1) |
- ; | |--------| | |--------|
- ; | | | | | |
- ; | | | | | |
- ; | | | | | |
- ; | | | | | |
- ; | |--------| | |--------|
- ; +----->|X(n-k+1)| X(n+1) +<-----| c(k-1) |
- ; t+T |--------| |--------|
- ; | | | |
- ;
- ;
- ; C(0)
- ; ___ ___
- ; x(n) / \ / \ y(n)
- ; -------------+----------| X |----->| + |--------->
- ; | \___/ \___/
- ; | ^ k-1
- ; | | ____
- ; +-----+ | \ '
- ; | T | C(1) | y(n)= /___,c(p)x(n-p)
- ; +-----+ ___ | p=0
- ; | / \ |
- ; +----------| X |-------->+
- ; | \___/ |
- ; +-----+ |
- ; | T | C(2) |
- ; +-----+ ___ |
- ; | / \ |
- ; +----------| X |-------->+
- ; | \___/ |
- ; | |
- ; | |
- ; | |
- ; | |
- ; | |
- ; | |
- ; +-----+ |
- ; | T | C(K-1) |
- ; +-----+ ___ |
- ; | / \ |
- ; +----------| X |-------->+
- ; \___/
- ;
- ;
- ; F I R
- ;
- ;**************************************************************************
- ;
- ; initialization
- ;**********************
- n equ 20
- start equ $40
- data equ $0
- coef equ $0
- input equ $ffe0
- output equ $ffe1
- ;
- ; Program Icycles
- ; Words
- ;
- move #data,r0 ; 1 1
- move #coef,r4 ; 1 1
- move #n-1,m0 ; 1 1
- fclr d1 m0,m4 ; 1 1
- ; --- ---
- ; Filter loop: n+11 cycles 4 4
- ;****************************************************
- movep y:input,d0.l ; 1 2
- float d0,d0 ; 1 1
- move d0.s,x:(r0) ; 1 1
- fclr d0 x:(r0)+,d4.s y:(r4)+,d6.s ;1 1
- rep #n ; 1 2
- fmpy d4,d6,d1 fadd d1,d0 x:(r0)+,d4.s y:(r4)+,d6.s ;1 1
- faddr d1,d0 (r0)- ; 1 1
- int d0,d0 ; 1 1
- movep d0.l,y:output ; 1 2
- ;****************************************************
- ; --------------------
- ; 9 n+11
-
- ; Totals 13 1N+15
- ; (13 1N+15)
- end
-
-
-